<%@ page import="org.jeecgframework.web.util.StaticValue" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<div class="easyui-layout" fit="true">
  <div region="center" style="padding:1px;">
  <t:datagrid name="cbsAttachTaskList" sortName="createDate"
              sortOrder="desc" checkbox="true" fitColumns="false" title="附加任务" actionUrl="cbsAttachTaskController.do?datagrid" idField="id"  queryMode="group">
   <t:dgCol title="主键"  field="id"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="对象"  field="objectName"    queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="设备序列号"  field="equipmentId.sn" hidden="true" query="true"   queryMode="single"  width="100"></t:dgCol>
   <t:dgCol title="影院名称"  field="cinemaId.name" query="true"  hidden="true" queryMode="single"  width="100"></t:dgCol>
   <%--<t:dgCol title="省市"		field="cinemaId.province.territoryName"	hidden="true"	queryMode="single"  query="true" sortable="false" />--%>
   <%--<t:dgCol title="省市"		field="equipmentId.province.territoryName"	hidden="true"	queryMode="single"  query="true" sortable="false" />--%>
   <t:dgCol title="相关设备ID"  field="equipmentId" hidden="true"   queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="待办任务"  field="content"    queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="任务状态"  field="status"    queryMode="single" query="true"  width="120" dictionary="<%=StaticValue.FINSHSTATUS %>"></t:dgCol>
   <t:dgCol title="分派次数"  field="assignmentTotal"  url="cbsAttachTaskController.do?goServiceByFP&id={id}" funname="planDetails"   queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="已完成次数"  field="completeTotal"  url="cbsAttachTaskController.do?goServiceByCompleted&id={id}" funname="planDetails"   queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="未完成次数"  field="notCompleteTotal"  url="cbsAttachTaskController.do?goServiceByNotCompleted&id={id}" funname="planDetails"   queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="创建人名称"  field="createName"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="创建人登录名称"  field="createBy"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="创建日期"  field="createDate" formatter="yyyy-MM-dd" hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="更新人名称"  field="updateName"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="更新人登录名称"  field="updateBy"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="更新日期"  field="updateDate" formatter="yyyy-MM-dd" hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="操作" field="opt" width="100"></t:dgCol>
   <t:dgFunOpt title="完成" funname="goView(id)" exp="status#eq#1,2"></t:dgFunOpt>
   <t:dgToolBar title="新建待办任务" icon="icon-add"  funname="add"></t:dgToolBar>
   <t:dgFunOpt title="取消" funname="goView2(id)" exp="status#eq#1,2"></t:dgFunOpt>
   <%--<t:dgToolBar title="批量删除"  icon="icon-remove" url="cbsAttachTaskController.do?doBatchDel" funname="deleteALLSelect"></t:dgToolBar>--%>
   <%--<t:dgToolBar title="查看" icon="icon-search" url="cbsAttachTaskController.do?goUpdate" funname="detail"></t:dgToolBar>--%>
   <%--<t:dgToolBar title="导入" icon="icon-put" funname="ImportXls"></t:dgToolBar>--%>
   <t:dgToolBar title="导出" icon="icon-putout" funname="ExportXls"></t:dgToolBar>
   <%--<t:dgToolBar title="模板下载" icon="icon-putout" funname="ExportXlsByT"></t:dgToolBar>--%>
  </t:datagrid>
  </div>
 </div>
 <script src = "webpage/com/zybk/cbsattachtask/cbsAttachTaskList.js"></script>		
 <script type="text/javascript">
     territoryLink('cbsAttachTaskList','cinemaId.province.territoryName',1);
     // territoryLink('cbsAttachTaskList','equipmentId.province.territoryName',1);
     // $(function(){
     //     // territoryLink("zyCinemaList","territoryName");
     //     territoryLink("cbsAttachTaskList","cinemaId.province");
     // });
 $(document).ready(function(){
 		//给时间控件加上样式
 			$("#cbsAttachTaskListtb").find("input[name='createDate']").attr("class","Wdate").attr("style","height:20px;width:90px;").click(function(){WdatePicker({dateFmt:'yyyy-MM-dd'});});
 			$("#cbsAttachTaskListtb").find("input[name='updateDate']").attr("class","Wdate").attr("style","height:20px;width:90px;").click(function(){WdatePicker({dateFmt:'yyyy-MM-dd'});});
 });
     function planDetails(fName,url){
         addOneTab("服务单管理",url);
     }
//导入
function ImportXls() {
	openuploadwin('Excel导入', 'cbsAttachTaskController.do?upload', "cbsAttachTaskList");
}

//导出
function ExportXls() {

    JeecgExcelExport("cbsAttachTaskController.do?exportXls","cbsAttachTaskList");
    // var currPageRows = $("#cbsAttachTaskList").datagrid("getRows");
    // var idsData = [];
    // $(currPageRows).each(function (i, rowData) {
    //     idsData.push(rowData.id);
    // });
    // alert(idsData);
    // if (idsData.length > 0) {
    //     myDownload("cbsAttachTaskController.do?exportAttachTaskInspectionPlan", "planIds=" + idsData.join(","),"POST");
    // } else {
    //     tip("当前页面没有数据可以导出");
    // }
}

//模板下载
function ExportXlsByT() {
	JeecgExcelExport("cbsAttachTaskController.do?exportXlsByT","cbsAttachTaskList");
}
     function add() {
         addOneTab('新建待办任务', 'cbsAttachTaskController.do?goAdd', '');
     }
     function goView(id) {

         createwindow('', 'cbsAttachTaskController.do?goUpdate&id='+id);
     }
     function goView2(id) {

         createwindow('', 'cbsAttachTaskController.do?goUpdateRemarks&id='+id);
     }
 </script>